﻿/************************************************************************

   Extended Silverlight Toolkit

   Copyright (C) 2010-2012 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://extendedsilverlight.codeplex.com/license

   Please purchase a commercial version of this toolkit if you are using
   it in a commercial product. The commercial versions support the project,
   and also include more features for each control, priority support,
   source code, updates, removed watermark, and a proprietary license.

   Visit http://xceed.com and follow @datagrid on Twitter.

  **********************************************************************/

using System.Windows;

// This source code obtained from CodeProject and 
// the URL is http://www.codeproject.com/KB/silverlight/TextOnAPathSilverlight.aspx?msg=2872095.
namespace Xceed.Silverlight.Utils
{
  internal class PointHelper
  {
    public PointHelper()
    {
    }

    public Point Value
    {
      get
      {
        return m_value;
      }
      set
      {
        m_value = value;
      }
    }

    public PointHelper( Point input )
    {
      m_value = input;
    }

    public static Vector operator -( PointHelper point1, PointHelper point2 )
    {
      return new Vector( point1.m_value.X - point2.m_value.X, point1.m_value.Y - point2.m_value.Y );
    }

    //
    // Summary:
    //     Translates the specified System.Windows.Point by the specified System.Windows.Vector
    //     and returns the result.
    //
    // Parameters:
    //   point:
    //     The point to translate.
    //
    //   vector:
    //     The amount by which to translate point.
    //
    // Returns:
    //     The result of translating the specified point by the specified vector.
    public static PointHelper operator +( PointHelper point, Vector vector )
    {
      PointHelper result = new PointHelper();

      result.m_value.X = vector.X + point.Value.X;
      result.m_value.Y = vector.Y + point.Value.Y;

      return result;
    }

    Point m_value;
  }
}
